package com.system.outpatientsystem.mapper;

import com.system.outpatientsystem.pojo.appointment_table;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper

public interface AppointmentMapper {

    @Insert("INSERT INTO appointment_table(id,user_id,doctor_id,begin_time,end_time,expire_status)" +
            "VALUES (#{id} ,#{userId}, #{doctorId},#{beginTime},#{endTime},#{expireStatus})")
    void add(appointment_table table);

    @Select("select * from appointment_table where user_id=#{userId}")
    List<appointment_table> findByuserId(Integer userId);

    @Select("select * from appointment_table where user_id=#{userId}")
    List<appointment_table> list(Integer userId);

    @Delete("delete from appointment_table where id=#{id}")
    void deleteById(Integer id);
    @Select("select * from appointment_table where id=#{id}")
    appointment_table findById(Integer id);
}
